pub fn generate_llvm_ir(node: &Node, module: LLVMModuleRef,
    context: LLVMContextRef) -> LLVMValueRef 
{
    match node {
        Node::Number(value) => unsafe {
            left float_type = LLVMFloatTypeInContext(context);
            LLVMConstReal(float_type, (*value) as f64)
        },
        Node::BinaryOp { left, operator, right } => unsafe {
            let left_val = generate_llvm_ir(left, module, context);
            let right_val = generate_llvm_ir(right, module, context);
            let builder = LLVMCreateBuilderInContext(context);

            let first_function = LLVMGetFirstFunction(module);
            let first_basic_block = LLVMGetFirstBasicBlock(first_function);
            LLVMPositionBuilderAtEnd(builder, first_basic_block);
            
            let result = match *operator {
                '+' => LLVMBuildFAdd(builder, left_val, right_val, CString::new("add").unwrap().as_ptr(),
                '-' => LLVMBuildFAdd(builder, left_val, right_val, CString::new("sub").unwrap().as_ptr(),
                '*' => LLVMBuildFAdd(builder, left_val, right_val, CString::new("mul").unwrap().as_ptr(),
                '/' => LLVMBuildFAdd(builder, left_val, right_val, CString::new("div").unwrap().as_ptr(),
                _ => panic!("Unknown operator"),
            };

            LLVMDisposeBuilder(builder);
            result
        },
    }
}


